package com.sduept.nwld.dataserver.manager.gismap;

import com.sduept.cim.model.extend.LineTower;
import com.sduept.core.dao.SuperDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 地图元素获取服务类
 * @author ldx
 *
 */
@Service
public class MapGisElementQueryService {	

	@Autowired
	SuperDAO dao;	
	
	/**
	 * 根据线路id返回所有杆塔集合
	 * @param lineId
	 * @return
	 * @throws Exception
	 */
	public List<LineTower> queryLine(Integer isshow,Integer isloop,String lineId) throws Exception{
		List<LineTower> lts_result= dao.findByCondition(LineTower.class, "isshow=? and is_loop=? and line_cim_id=? order by sel", isshow,isloop,lineId);
		return lts_result;
	}
	
	
	/**
	 * 根据杆塔Id返回杆塔对象
	 * @param towerId
	 * @return
	 * @throws Exception
	 */
	public LineTower queryLineTowerById(String towerId)throws Exception{
		return dao.findById(towerId, LineTower.class);
	}

}
